function getTree() {
	var tree = [
	            {
	              text: "Parent 1",
	              nodes: [
	                {
	                  text: "Child 1",
	                  nodes: [
	                    {
	                      text: "Grandchild 1"
	                    },
	                    {
	                      text: "Grandchild 2"
	                    }
	                  ]
	                },
	                {
	                  text: "Child 2"
	                }
	              ]
	            },
	            {
	              text: "Parent 2"
	            },
	            {
	              text: "Parent 3"
	            },
	            {
	              text: "Parent 4"
	            },
	            {
	              text: "Parent 5"
	            }
	          ];
    return tree;
}
$('#tree').treeview({data: getTree()});


//组织机构树形菜单的控制方法
function makeSelected(id)
{
	user_userAdd_orgid=id;
	orgname
	//关闭树形菜单
	closeTree();
	jsondata={
		"orgid":id
	};
	//重新加载列表
	$("#zuzhi").bootgrid("reload");
}

//修改并保存返回主页
function userEdit() {
	$.ajax({	
        cache: false,
        type: "POST",
        url:"/platform/windows/user/edit",        
        data:$('#userEditForm').serialize(),
        async: false,
        success: function(data) {
            if(data.message=="ok")
            {            	
            	window.location.href=getWebRootPath()+"/windows/user.html";            	
            }
            else
            {
            	$("#userEditForm").reset();
            	$("#tree").focus();
            }
        }
    });
}

//取消
function goBack()
{
	window.location.href=getWebRootPath()+"/windows/user.html";
}
